#pragma once

namespace	MomogenkyouSystem	{

class	ScreenTemplate;

//	The app state manager is a component which manages one or more GameScreen
//	instances. It maintains a stack of screens, calls their Update and Draw
//	methods at the appropriate times, and automatically routes input to the
//	topmost active screen.

class	ScreenManager
{
	static	std::deque<ScreenTemplate	*>		m_Screens;
	static	std::deque<ScreenTemplate	*>		m_ScreensToUpdate;

	static	TEXTURE								g_pBlankTexture;
	static	SPRITEBATCH							g_pSpriteBatch;
public:
	ScreenManager();
	virtual	~ScreenManager();

	static	void								Initialize();
	static	void								Shutdown();

	//	Adds a new screen to the screen manager.
	static	void								AddScreen(ScreenTemplate * pScreen);
	//	Removes a screen from the screen manager. You should normally
    //	use ScreenTemplate's ExitScreen instead of calling this directly, so
    //	the screen can gradually transition off rather than just being
    //	instantly removed.
	static	void								RemoveScreen(ScreenTemplate * pScreen);
	
	//	Helper draws a translucent black fullscreen sprite, used for fading
    //	screens in and out, and for darkening the background behind popups.
	static	void								FadeBackBufferToBlack(const int & nAlpha);

	static	void								UpdateScreens(const float & fInterval);
	static	void								RenderScreens(const float & fInterval);

#if _DEBUG
	//	Print out all the screens
	static	void								CmdOutput();
#endif
};

}